package lsf.itcast.dao;


import lsf.itcast.domain.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ProductDao {
    /**
     * 关联查询，查询订单，带产品信息
    * */
    @Select("select * from product where id=#{id}")
    Product findById(String id);
    /**
     * 查询所有产品信息
    * */
    @Select("select * from product")
    List<Product> findAllProdunct();
    /**
    保存新增产品信息
     */
    @Insert("insert into product (productNum,productName,cityName,departureTime,productPrice,productDesc,productStatus) " +
            "values(#{productNum},#{productName},#{cityName},#{departureTime},#{productPrice},#{productDesc},#{productStatus}) ")
    void saveProduct(Product product);
}
